'use strict';

module.exports = app => {
  const { STRING, INTEGER, DATE } = app.Sequelize;

  const Goods = app.model.define('goods', {
    id: { type: INTEGER, primaryKey: true, autoIncrement: true },
    name: STRING(30),
    img: {
      type: STRING,
      allowNull: false,
      comment: '商品图片',
    },
    describe: {
      type: STRING,
      allowNull: false,
      comment: '商品内容',
    },
    price: INTEGER,
    gain: INTEGER,
    created_at: DATE,
    updated_at: DATE,
  });

  return Goods;
};
